package com.clement.factory.simple;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by Clement on 2017/6/13.
 */
public class Main {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(Config.class);
        AbstractHumanFactory factory = applicationContext.getBean(HumanFactory.class);
        IHuman whiteMan = factory.createHuman(WhiteHuman.class);
        whiteMan.talk();
    }
}
